import ResLoading from "./ResLoading";

class ResLoadingAdapter {
    show(info: { title: string }) {
        if (window['wx']) {
            window['wx']?.showLoading?.(info);
        } else {
            ResLoading.show(info.title);
        }
    }

    hide() {
        if (window['wx']) {
            window['wx']?.hideLoading?.()
        } else {
            ResLoading.hide();
        }
    }
}

export default new ResLoadingAdapter();